<style>
table th{
 white-space:nowrap;
}
table#jinyun_table {
  border:none;
  border-left:1px solid #e7e7eb;
}
table#jinyun_table th {
  background-color: rgb(246, 248, 249);
  position:sticky;
  top:-1px;
  z-index:1;
}
table#jinyun_table td {
  background:#fff;
}
table#jinyun_table th:first-child {
  position:sticky;
  left:-1px;
  z-index:2;
}
table#jinyun_table td:first-child {
  background:#fff;
  position:sticky;
  left:-1px;
  z-index:1;
}
table#jinyun_table th:last-child {
  position:sticky;
  right:0;
  z-index:2;
}
table#jinyun_table td:last-child {
  background:#fff;
  position:sticky;
  right:0;
  z-index:1;
}
</style>
<div class="clearfix table-responsive">
	<div class="alert alert-success alert-dismissable" ng-if="'{tip}'!=''">
		<i class="fa fa-bullhorn alert-link"></i>{tip}
		<a ng-if="'{helplink}'!=''" href="javascript:;" ng-click="modal_json('{helplink}')" class="btn btn-primary" style="padding:2px 6px;font-size:12px;">{help}</a>
	</div>
	<div class="fixed-table-toolbar">
		<div class="bs-bars pull-left" style="margin-top:0">
			<div id="toolbar" class="tab-toolbar" style="width:auto;position: relative;">
				<a ng-if="{delall}" ng-click="post({},'{del_op}','del='+{pagevalue}.del,'','{del_message}')" href="javascript:;" class="btn btn-danger btn-del btn-disabled" title="{del_title}"><i class="fa fa-trash"></i> {{check_show_lang('{del_title}_dele')}}</a> 
				<span ng-repeat="bat in {batch}">
					<a ng-if="bat.type=='modal'" ng-click="access_modal(bat.url,made_query({pagevalue}.params)+'&ids='+{pagevalue}.del)" href="javascript:;" class="btn btn-black btn-refresh" title="{{bat.title}}">{{check_show_lang(bat.title)}}</a>
					<a ng-if="bat.type=='href'" ng-click="access_json(bat.url,made_query({pagevalue}.params)+'&ids='+{pagevalue}.del)" href="javascript:;" class="btn btn-black btn-refresh" title="{{bat.title}}">{{check_show_lang(bat.title)}}</a>
					<a ng-if="bat.type=='post'" ng-click="post({},bat.url,made_query({pagevalue}.params)+'&ids='+{pagevalue}.del,'',bat.msg)" href="javascript:;" class="btn btn-black btn-refresh" title="{{bat.title}}">{{check_show_lang(bat.title)}}</a>
					<a ng-if="bat.type=='api'" ng-href="{{export(bat.url,made_query({pagevalue}.params)+'&ids='+{pagevalue}.del)}}" href="javascript:;" class="btn btn-black btn-refresh" title="{{bat.title}}">{{check_show_lang(bat.title)}}</a>					
				</span>
				<a ng-if="'{paixu}'!='none'" ng-click="post({pagevalue}.{paixu},'{paixu_op}')" href="javascript:;" class="btn btn-black" title="排序">提交排序</a> 
				<a style="display:none;" href="javascript:;" class="btn btn-black btn-refresh" title="刷新"><i class="fa fa-refresh"></i> </a> 
				<a style="display:none;" href="javascript:;" class="btn btn-success btn-add" title="添加"><i class="fa fa-plus"></i> {{check_show_lang('添加','add')}}</a> 
				<a style="display:none;" href="javascript:;" class="btn btn-info btn-import" title="导入" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false" initialized="true" style="position: relative; z-index: 1;"><i class="fa fa-upload"></i> {{check_show_lang('导入_Import')}}</a>                        
			</div>
		</div>
		<div class="btn-group pull-right">
			<div id="toolbar" class="tab-toolbar" style="width:auto;position: relative;">
				<a ng-if="{openvoice} && !main.isopenvoice" ng-click="main.isopenvoice=true;pagedata.openvoice(true)" href="javascript:;" class="btn btn-gray"><i class="icon icon-nolingsheng0" style="font-size:12px"></i> {{check_show_lang('关闭中_Close')}}</a>
				<a ng-if="{openvoice} && main.isopenvoice" ng-click="main.isopenvoice=false;pagedata.openvoice(false)" href="javascript:;" class="btn btn-primary"><i class="icon icon-lingsheng0" style="font-size:12px"></i> {{check_show_lang('开启中_Open')}}</a>
			</div>
		</div>
	</div>
	<div class="page-header" ng-if="'{title}'!=''"><h5 class="bold">{title}</h5></div>
	<div id="tablestart" style="overflow: auto;{{'{nomaxheight}'!=1?'max-height:calc(100vh - 300px);overflow: auto;':''}}">
	<table class="table jinyun-table table-hover vertical-middle jinyun-form" id="jinyun_table" style="table-layout: auto;">
		<thead class="navbar-inner">
			<tr>
				<th width="52px" ng-if="{show_choose}">
				<label><input type="checkbox" name=""  class="jinyun-margin-left" onclick="var ck = this.checked;$(this).parents('table').find(':checkbox').each(function(){if(this.checked != ck){$(this).click();}});">&nbsp;</label>
				</th>
				<th ng-if="'{paixu}'!='' && '{paixu}'!='none'" width="100px">排序</th>
				{list_head}
				<th ng-if="{show_action}" style="word-break : break-all;">{{check_show_lang('操作','operation')}}</th>
			</tr>
		</thead>
		<tbody style="">
		<tr ng-repeat="item in {pagevalue}.{data}">
				<td class="text-left" ng-if="{show_choose}">
					<label class="text-over reply-item-name">
					<input type="checkbox" ng-click="duoxuans(item.{key},{pagevalue},'del')">&nbsp;</label>
				</td>
				<td class="text-left" ng-if="'{paixu}'!='' && '{paixu}'!='none'">
					<input type="text" style="width:80px" ng-model="{pagevalue}.{paixu}[item.{key}]">
				</td>
				{list}
				<td ng-if="{show_action}" style="max-width: 800px; white-space:nowrap;">
					{action}
					<a ng-if="{edit}" href="javascript:;" ng-click="access('{edit_op}','{key}='+item.{key})" class="btn btn-primary" data-original-title="编辑">
						<i class="fa fa-pencil"></i>
					</a>
					<a ng-if="{del_one}" href="javascript:;" ng-click="post({},'{del_op}','{key}='+item.{key},'','{del_message}')" data-original-title="删除" class="btn btn-danger btn-sm">
						<i class="fa fa-trash"></i>
					</a>
				</td>
			</tr>
		</tbody>
	</table>
	</div>
	<div ng-if="{pagelist}">
		<div class="text-right" >
		<div class="pull-right">
			<ul class="pagination pagination-centered">
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>1" ng-click="{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{check_show_lang('首页','home')}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>1" ng-click="{pagevalue}.params.page={pagevalue}.params.page-1;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">&laquo;{{check_show_lang('上一页','up page')}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>5" ng-click="{pagevalue}.params.page={pagevalue}.params.page-5;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page-5}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>4" ng-click="{pagevalue}.params.page={pagevalue}.params.page-4;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page-4}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>3" ng-click="{pagevalue}.params.page={pagevalue}.params.page-3;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page-3}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>2" ng-click="{pagevalue}.params.page={pagevalue}.params.page-2;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page-2}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page>1" ng-click="{pagevalue}.params.page={pagevalue}.params.page-1;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page-1}}</a></li>
				<li class="active"><a href="javascript:;" ng-if="{pagevalue}.totalpage>1" class="pager-nav">{{{pagevalue}.params.page}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page+1<={pagevalue}.totalpage" ng-click="{pagevalue}.params.page={pagevalue}.params.page+1;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page+1}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page+2<={pagevalue}.totalpage" ng-click="{pagevalue}.params.page={pagevalue}.params.page+2;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page+2}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page+3<={pagevalue}.totalpage" ng-click="{pagevalue}.params.page={pagevalue}.params.page+3;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page+3}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page+4<={pagevalue}.totalpage" ng-click="{pagevalue}.params.page={pagevalue}.params.page+4;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{{pagevalue}.params.page+4}}</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page<{pagevalue}.totalpage" ng-click="{pagevalue}.params.page={pagevalue}.params.page+1;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{check_show_lang('下一页','next page')}}&raquo;</a></li>
				<li><a href="javascript:;" ng-if="{pagevalue}.params.page<{pagevalue}.totalpage" ng-click="{pagevalue}.params.page={pagevalue}.totalpage;{access}({pagevalue}.op,made_query({pagevalue}.params))" class="pager-nav">{{check_show_lang('尾页','back page')}}</a></li>
			</ul>
		</div>
		<div class="pull-right pagination pagination-detail" style="line-height: 26px;margin-right: 20px">
			<span ng-if="{total}" class="pagination-info" style="color:black;">总共 {total} 条记录</span>
			<span ng-if="{psize}" class="page-list" style="color:black;">{{check_show_lang('每页显示','Each page shows')}} 
			<span class="btn-group dropup">
			<button type="button" onclick="$(this).next().toggle()" class="btn btn-gray dropdown-toggle" style="padding:2px 6px">
			<span class="page-size">{psize}</span> 
			<span class="caret"></span>
			</button>
			<ul class="dropdown-menu" role="menu" style="min-width:40px">
				<li role="menuitem" ng-class="{'active':{psize}==10}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=10;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">10</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==15}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=15;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">15</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==20}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=20;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">20</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==25}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=25;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">25</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==50}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=50;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">50</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==100}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=100;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">100</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==200}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=200;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">200</a></li>
				<li role="menuitem" ng-class="{'active':{psize}==500}"><a href="javascript:;" ng-click="{pagevalue}.params.psize=500;{pagevalue}.params.page=1;{access}({pagevalue}.op,made_query({pagevalue}.params))" style="padding: 3px 10px;">500</a></li>
			</ul>
			</span> 条记录{{main.tableHeight}}</span>
		</div>
		</div>
	</div>
</div>
<audio id="openvoice" controls preload="auto" style="display:none;">
	<source src="../core/resource/images/neworder.mp3"></source>
</audio>
<div ng-if="pagedata.show_bottomloading" id="msg-bottomloading">
	<a href="javascript:;" ng-click="pagedata.show_bottomloading=false"><i class="fa fa-times"></i></a>
	<div class="msg_text">
		您有新订单请注意查收！详情刷新页面查看列表！
	</div>
</div>
<script type="text/javascript"> 
var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题 
var table = document.getElementById("jinyun_table"); 
for (j = 0; j < table.rows[0].cells.length; j++) {
	table.rows[0].cells[j].onmousedown = function () { 
	//记录单元格 
		//console.log('event');console.log(event);
		tTD = this; 
		if (event.offsetX > tTD.offsetWidth - 10) { 
		tTD.mouseDown = true; 
		tTD.oldX = event.x; 
		tTD.oldWidth = tTD.offsetWidth; 
		} 
		//记录Table宽度 
		//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement; 
		//tTD.tableWidth = table.offsetWidth; 
	}; 
	table.rows[0].cells[j].onmouseup = function () { 
	//结束宽度调整 
		if (tTD == undefined) tTD = this; 
		tTD.mouseDown = false; 
		tTD.style.cursor = 'default'; 
	}; 
	table.rows[0].cells[j].onmousemove = function () { 
	//更改鼠标样式 
		if (event.offsetX > this.offsetWidth - 10) 
		this.style.cursor = 'col-resize'; 
		else 
		this.style.cursor = 'default'; 
		//取出暂存的Table Cell 
		if (tTD == undefined) tTD = this; 
		//调整宽度 
		if (tTD.mouseDown != null && tTD.mouseDown == true) { 
			tTD.style.cursor = 'default'; 
			if (tTD.oldWidth + (event.x - tTD.oldX)>0) 
			tTD.width = tTD.oldWidth + (event.x - tTD.oldX); 
			//调整列宽 
			tTD.style.width = tTD.width; 
			//console.log('tTD.width');console.log(tTD.width);
			tTD.style.cursor = 'col-resize'; 
			//调整该列中的每个Cell 
			table = tTD; while (table.tagName != 'TABLE') table = table.parentElement; 
			for (j = 0; j < table.rows.length; j++) { 
				table.rows[j].cells[tTD.cellIndex].width = tTD.width; 
			} 
			//调整整个表 
			//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth); 
			//table.style.width = table.width; 
		} 
	}; 
}
scope.pagedata.openvoice=function(type){
	var voicetime = 0;
    var openvoice;
	for(var i = 1;i<=100;i++){
		clearInterval(i);
	}
	if(type){
		 openvoice = setInterval(() => {
			if(!scope.main.isopenvoice){
				clearInterval(openvoice);
				return false;
			}
			scope.get('{openvoice_action}',function(res){
						//console.log('openvoice');console.log(res);
						if(res!='none'){
							voicetime ++;
							$("#openvoice")[0].play();
							scope.pagedata.show_bottomloading=true;
						}
			});
		}, 5000);
	}
}
</script>

